<?php

namespace app\http\middleware;
use think\facade\Session;
use think\facade\Request;
class language
{
    public function handle($request, \Closure $next)
    {
        $language=Request::param('language');
        if($language){
            Session::set('language',$language);
        }else{
            $language=Session::has('language');
            if(!$language) {
                Session::set('language', 'en');
            }
        }
        //获取语言本身
        return $next($request);
    }
}
